<?php

class NTemplateEngine{

/**
* File with template content
* var string
* access privet
*/
	var $_template="";



  private static $_instances;

 static function &getInstance($type="php",$args=array()) {

        $signature = $type.serialize($args);
	
    if (!isset(self::$_instances[$signature])) {
		$engine_filename = dirname(__FILE__).'/engines/'.strtolower($type). "_engine.php";
	if ($engine_filename){
	require_once($engine_filename);
		$classname = "N".ucfirst($type)."Engine";
	}
	
      //$c = __CLASS__;
      self::$_instances[$signature] = new $classname($args);
    }
    return self::$_instances[$signature];
  }



}
?>